
import java.io.Serializable;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.List;
import Dict.*;
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author dtuanh
 */
public class WordImpl extends Dict.WordPOA  {
    private CategoryValue cat;
    PropertyType ls_property ;
    public String term;
 
    public CategoryValue myCategory()  {
        return cat;
    }

    public void setCategory(CategoryValue cat) {
        this.cat = cat;
    }

    public PropertyType myProperties()  {
      return ls_property;
    
    }

    public void setProperty(PropertyType p) {
        this.ls_property=p;
    }

    
    

    public String myTerm() {
        return term;
    }

    public void setTerm(String term) {
        this.term = term;
    }

    //encoder le Word en fichier
    public String toFile() {
        if(this.ls_property.pAdj()!=null)return toFileProperty(ls_property.pAdj(),term);
        if(this.ls_property.pVer()!=null)return toFileProperty(ls_property.pVer(),term);
        if(this.ls_property.pNom()!=null)return toFileProperty(ls_property.pNom(),term);
        return null;
    }
      private String toFileProperty(PropNom pro,String term) {
        String ret = "«" + term + "», <";
          if(pro.genre==Dict.PropGenreValue.MASC)ret+="MASC,";
          else ret+="FEM,";
        ret+="«" +pro.pluriel+"»>";
         return ret;
    }
       private String toFileProperty(PropAdj pro,String term) {
        String ret = "«" + term + "», <";
          ret+="«" +pro.feminin+"»,";

        ret+="«" +pro.pluriel+"»>";
         return ret;
    }
       private String toFileProperty(PropVer pro,String term) {
        String ret = "«" + term + "», <";
          if(pro.groupe==Dict.PropGroupeValue.G1)ret+="1,";
          if(pro.groupe==Dict.PropGroupeValue.G2)ret+="2,";
          if(pro.groupe==Dict.PropGroupeValue.G3)ret+="3,";
        if(pro.transitivite==Dict.PropTransValue.TRANS)
        ret+="TRANS>";
        else ret+="INTR>";

        return ret;
    }
}


